<template>
    <el-dialog title="收货地址" :visible.sync="open">
      <el-form :model="form">
        <el-form-item label="活动名称" >
          <file-upload ref="upload" :limit="1" :file-type="['xls','xlsx']" :file-size="5" @input="handInput">
          </file-upload>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="open=false">取 消</el-button>
        <el-button type="primary" @click="submitForm">确 定</el-button>
      </div>
    </el-dialog>
</template>

<script>
import FileUpload from "@/components/FileUpload/index.vue";
import {uploadClue} from '@/api/crm/clue';
export default {
  name: "batch-add",
  components:{FileUpload},
  data(){
    return{
      open:false,
      form:{
        filename:null,
      }
    }
  },methods:{
    handInput(fileNames){
      this.form.filename=fileNames;
    },submitForm(row){
      uploadClue(this.form).then(()=>{
        this.clearFiles()
        this.$modal.msgSuccess('操作成功');
        this.open=false
      })
    },clearFiles () {
      this.$refs['upload'].clearFiles();
    }

  }
}
</script>

<style scoped>

</style>
